require('./Slidebanner.styl');
const { Component } = React;
import {Slide} from 'saltui'
const classNames = require('classnames');
class Slidebanner extends React.Component {

    constructor(props) {
        super(props);
        this.state = {
        };
    }
    handleClick() {
        this.props.cb();  
    }
    render() {
        let t = this;
        return (
            <Slide showNav auto className={classNames('',{'tHide':!t.props.isShow})} >
            {
                this.props.bannerList.length!=0 ?
                    this.props.bannerList.map((item, index) => (
                        <div className="cs-civil-topbg"
                            key={index}
                            style={{
                                backgroundImage: `url(${item.img})`,
                                backgroundRepeat: 'no-repeat',
                                backgroundPosition: 'center',
                                backgroundSize: '100% 100%',
                            }}
                        >
                            <div className="cs-civil-top-top">
                                <span></span>
                                <span className="cs-more" onClick={this.handleClick.bind(this)}></span>
                            </div>
                            <div className="cs-civil-top-middle">
                                <img  src={item.src} />
                                <div className="cs-weatherState">
                                    <p>{item.tit}</p>
                                    <p className="civilp">{item.tys}</p>
                                </div>
                                <strong>{item.tems}</strong>
                            </div>
                            <div className="cs-civil-top-bottom"><span>&nbsp;{item.vis}</span>{item.pms}</div>
                        </div>
                    ))
                    : [
                        <img  width="48"  src="//aliwork.alicdn.com/tps/TB1fPYRMXXXXXcdXFXXXXXXXXXX-480-238.svg" />,
                    ]
            }
        </Slide>
        );
    }

    componentWillMount() {
    }

    componentDidMount() {
    }

    componentWillReceiveProps(nextProps) {
    }

    shouldComponentUpdate(nextProps, nextState) {
        return true;
    }

    componentWillUpdate(nextProps, nextState) {
    }

    componentDidUpdate(prevProps, prevState) {
    }

    componentWillUnmount() {
    }
}

module.exports = Slidebanner;
